package com.ffapp.demo.bean;

import android.text.TextUtils;

import com.amap.api.maps.model.LatLng;
import com.ffapp.demo.R;
import com.ffapp.demo.map.GPSUtil;

import java.util.List;

public class Troubleshoots extends BasisBean {

    private List<NormalTroubleList> normalTroubleList;
    private List<BigTroubleList> bigTroubleList;
    private String buildName;
    private int noTrouble;
    private String latitude;
    private List<String> uncheckedList;
    private int unchecked;
    private String buildId;
    private List<String> checkedList;
    private int total;
    private int normalTrouble;
    private int checked;
    private int bigTrouble;
    private List<String> noTroubleList;
    private String longitude;
    private String checkStatus = "non";
    private String type;   //隐患类型，0：无隐患，1：一般隐患，2：重大隐患


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setNormalTroubleList(List<NormalTroubleList> normalTroubleList) {
        this.normalTroubleList = normalTroubleList;
    }

    public List<NormalTroubleList> getNormalTroubleList() {
        return normalTroubleList;
    }

    public void setBigTroubleList(List<BigTroubleList> bigTroubleList) {
        this.bigTroubleList = bigTroubleList;
    }

    public List<BigTroubleList> getBigTroubleList() {
        return bigTroubleList;
    }

    public void setBuildName(String buildName) {
        this.buildName = buildName;
    }

    public String getBuildName() {
        return buildName;
    }

    public void setNoTrouble(int noTrouble) {
        this.noTrouble = noTrouble;
    }

    public int getNoTrouble() {
        return noTrouble;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setUncheckedList(List<String> uncheckedList) {
        this.uncheckedList = uncheckedList;
    }

    public List<String> getUncheckedList() {
        return uncheckedList;
    }

    public void setUnchecked(int unchecked) {
        this.unchecked = unchecked;
    }

    public int getUnchecked() {
        return unchecked;
    }

    public void setBuildId(String buildId) {
        this.buildId = buildId;
    }

    public String getBuildId() {
        return buildId;
    }

    public void setCheckedList(List<String> checkedList) {
        this.checkedList = checkedList;
    }

    public List<String> getCheckedList() {
        return checkedList;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getTotal() {
        return total;
    }

    public void setNormalTrouble(int normalTrouble) {
        this.normalTrouble = normalTrouble;
    }

    public int getNormalTrouble() {
        return normalTrouble;
    }

    public void setChecked(int checked) {
        this.checked = checked;
    }

    public int getChecked() {
        return checked;
    }

    public void setBigTrouble(int bigTrouble) {
        this.bigTrouble = bigTrouble;
    }

    public int getBigTrouble() {
        return bigTrouble;
    }

    public void setNoTroubleList(List<String> noTroubleList) {
        this.noTroubleList = noTroubleList;
    }

    public List<String> getNoTroubleList() {
        return noTroubleList;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLongitude() {
        return longitude;
    }


    public String getCheckStatus() {
        return checkStatus;
    }

    public void setCheckStatus(String checkStatus) {
        this.checkStatus = checkStatus;
    }

    public int getMapMarkerResid() {    //隐患类型，0：无隐患，1：一般隐患，2：重大隐患
        switch (type) {
            case "0":
                return R.drawable.map_ok;
            case "1":
                return R.drawable.map_con_trouble;
            case "2":
                return R.drawable.map_big_trouble;
        }
        return R.drawable.map_ok;
    }

    public int getMapMarkerResidFromCheckStatus() {    //隐患类型，0：无隐患，1：一般隐患，2：重大隐患
        if(checkStatus.equals("0")){
            return R.drawable.map_non;
        }else {
            return R.drawable.map_ok;
        }
    }


    public LatLng getLatlng() {
        if (TextUtils.isEmpty(latitude) || TextUtils.isEmpty(latitude)) {
            return new LatLng(0, 0);
        }

        double[] gprs = GPSUtil.gps84_To_Gcj02(Double.valueOf(latitude),Double.valueOf(longitude));
        LatLng latLng = new LatLng(gprs[0], gprs[1]);
        return latLng;
    }



}
